package pro.shushi.pamirs.demo.api.model;

import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.base.common.VersionModel;

import java.math.BigDecimal;


@Model.model(ProductPrice.MODEL_MODEL)
@Model(displayName = "价格", labelFields = "ticketTypeName")
public class ProductPrice extends VersionModel {

    private static final long serialVersionUID = -5104390780952631397L;

    public static final String MODEL_MODEL = "demo.ProductPrice";

    @Field.Integer
    @Field(displayName = "库存id", invisible = true, index = true)
    private Long productStockId;

    @Field.many2one
    @Field.Relation(relationFields = {"ticketTypeId"}, referenceFields = {"id"})
    @Field(displayName = "票类型")
    private TicketType ticketType;

    @Field.Integer
    @Field(displayName = "票类型id", invisible = true)
    private Long ticketTypeId;

    @Field.String
    @Field.Related(related = {"ticketType", "name"})
    @Field(displayName = "票类型名称")
    private String ticketTypeName;

    @Field.Money(D = 2, min = "0.0")
    @Field(displayName = "公布价")
    private BigDecimal publicPrice;


    @Field.Money(D = 2, min = "0.0")
    @Field(displayName = "结算价")
    private BigDecimal price;


    @Field.Boolean
    @Field(displayName = "状态")
    private Boolean status;

}
